<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Doxygen: pcl::io::OrganizedConversion&lt; PointT, false &gt; 模板结构体 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Doxygen
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-static-methods">静态 Public 成员函数</a> &#124;
<a href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4-members.html">所有成员列表</a>  </div>
  <div class="headertitle">
<div class="title">pcl::io::OrganizedConversion&lt; PointT, false &gt; 模板结构体 参考</div>  </div>
</div><!--header-->
<div class="contents">
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
静态 Public 成员函数</h2></td></tr>
<tr class="memitem:aaa671985f19196a8bff9a17b28fdb7ce"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html#aaa671985f19196a8bff9a17b28fdb7ce">convert</a> (const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud_arg, float focalLength_arg, float disparityShift_arg, float disparityScale_arg, bool, typename std::vector&lt; uint16_t &gt; &amp;disparityData_arg, typename std::vector&lt; uint8_t &gt; &amp;)</td></tr>
<tr class="memdesc:aaa671985f19196a8bff9a17b28fdb7ce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert point cloud to disparity image  <a href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html#aaa671985f19196a8bff9a17b28fdb7ce">更多...</a><br /></td></tr>
<tr class="separator:aaa671985f19196a8bff9a17b28fdb7ce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab75504ecc6fa90059ae3d7839a4245d3"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html#ab75504ecc6fa90059ae3d7839a4245d3">convert</a> (typename std::vector&lt; uint16_t &gt; &amp;disparityData_arg, typename std::vector&lt; uint8_t &gt; &amp;, bool, size_t width_arg, size_t height_arg, float focalLength_arg, float disparityShift_arg, float disparityScale_arg, <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud_arg)</td></tr>
<tr class="memdesc:ab75504ecc6fa90059ae3d7839a4245d3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert disparity image to point cloud  <a href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html#ab75504ecc6fa90059ae3d7839a4245d3">更多...</a><br /></td></tr>
<tr class="separator:ab75504ecc6fa90059ae3d7839a4245d3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a579ab39217105926c1cbb6c49e52de2b"><td class="memItemLeft" align="right" valign="top">static void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html#a579ab39217105926c1cbb6c49e52de2b">convert</a> (typename std::vector&lt; float &gt; &amp;depthData_arg, typename std::vector&lt; uint8_t &gt; &amp;, bool, size_t width_arg, size_t height_arg, float focalLength_arg, <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;cloud_arg)</td></tr>
<tr class="memdesc:a579ab39217105926c1cbb6c49e52de2b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert disparity image to point cloud  <a href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html#a579ab39217105926c1cbb6c49e52de2b">更多...</a><br /></td></tr>
<tr class="separator:a579ab39217105926c1cbb6c49e52de2b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">成员函数说明</h2>
<a id="aaa671985f19196a8bff9a17b28fdb7ce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaa671985f19196a8bff9a17b28fdb7ce">&#9670;&nbsp;</a></span>convert() <span class="overload">[1/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="structpcl_1_1io_1_1_organized_conversion.html">pcl::io::OrganizedConversion</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a>, false &gt;::convert </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>cloud_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>focalLength_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>disparityShift_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>disparityScale_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::vector&lt; uint16_t &gt; &amp;&#160;</td>
          <td class="paramname"><em>disparityData_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::vector&lt; uint8_t &gt; &amp;&#160;</td>
          <td class="paramname">&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert point cloud to disparity image </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">cloud_arg</td><td>input point cloud </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">focalLength_arg</td><td>focal length </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">disparityShift_arg</td><td>disparity shift </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">disparityScale_arg</td><td>disparity scaling </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">disparityData_arg</td><td>output disparity image </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160;      {</div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;        <span class="keywordtype">size_t</span> cloud_size, i;</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160; </div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        cloud_size = cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.size ();</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160; </div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        <span class="comment">// Clear image data</span></div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;        disparityData_arg.clear ();</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;        disparityData_arg.reserve (cloud_size);</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160; </div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; cloud_size; ++i)</div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;        {</div>
<div class="line"><a name="l00115"></a><span class="lineno">  115</span>&#160;          <span class="comment">// Get point from cloud</span></div>
<div class="line"><a name="l00116"></a><span class="lineno">  116</span>&#160;          <span class="keyword">const</span> <a class="code" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a>&amp; point = cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>[i];</div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160; </div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160;          <span class="keywordflow">if</span> (pcl::isFinite (point))</div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160;          {</div>
<div class="line"><a name="l00120"></a><span class="lineno">  120</span>&#160;            <span class="comment">// Inverse depth quantization</span></div>
<div class="line"><a name="l00121"></a><span class="lineno">  121</span>&#160;            uint16_t disparity = <span class="keyword">static_cast&lt;</span>uint16_t<span class="keyword">&gt;</span> ( focalLength_arg / (disparityScale_arg * point.z) + disparityShift_arg / disparityScale_arg);</div>
<div class="line"><a name="l00122"></a><span class="lineno">  122</span>&#160;            disparityData_arg.push_back (disparity);</div>
<div class="line"><a name="l00123"></a><span class="lineno">  123</span>&#160;          }</div>
<div class="line"><a name="l00124"></a><span class="lineno">  124</span>&#160;          <span class="keywordflow">else</span></div>
<div class="line"><a name="l00125"></a><span class="lineno">  125</span>&#160;          {</div>
<div class="line"><a name="l00126"></a><span class="lineno">  126</span>&#160;            <span class="comment">// Non-valid points are encoded with zeros</span></div>
<div class="line"><a name="l00127"></a><span class="lineno">  127</span>&#160;            disparityData_arg.push_back (0);</div>
<div class="line"><a name="l00128"></a><span class="lineno">  128</span>&#160;          }</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;        }</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;      }</div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_af16a62638198313b9c093127c492c884"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">pcl::PointCloud::points</a></div><div class="ttdeci">std::vector&lt; PointT, Eigen::aligned_allocator&lt; PointT &gt; &gt; points</div><div class="ttdoc">The point data.</div><div class="ttdef"><b>Definition:</b> point_cloud.h:410</div></div>
<div class="ttc" id="astructpcl_1_1_point_x_y_z_r_g_b_a_html"><div class="ttname"><a href="structpcl_1_1_point_x_y_z_r_g_b_a.html">pcl::PointXYZRGBA</a></div><div class="ttdoc">A point structure representing Euclidean xyz coordinates, and the RGBA color.</div><div class="ttdef"><b>Definition:</b> point_types.hpp:540</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="a579ab39217105926c1cbb6c49e52de2b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a579ab39217105926c1cbb6c49e52de2b">&#9670;&nbsp;</a></span>convert() <span class="overload">[2/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="structpcl_1_1io_1_1_organized_conversion.html">pcl::io::OrganizedConversion</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a>, false &gt;::convert </td>
          <td>(</td>
          <td class="paramtype">typename std::vector&lt; float &gt; &amp;&#160;</td>
          <td class="paramname"><em>depthData_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::vector&lt; uint8_t &gt; &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>width_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>height_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>focalLength_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>cloud_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert disparity image to point cloud </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">depthData_arg</td><td>input depth image </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">width_arg</td><td>width of disparity image </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">height_arg</td><td>height of disparity image </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">focalLength_arg</td><td>focal length </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud_arg</td><td>output point cloud </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;      {</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160;        <span class="keywordtype">size_t</span> i;</div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;        <span class="keywordtype">size_t</span> cloud_size = width_arg * height_arg;</div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;        <span class="keywordtype">int</span> x, y, centerX, centerY;</div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160; </div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;        assert(depthData_arg.size()==cloud_size);</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160; </div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;        <span class="comment">// Reset point cloud</span></div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.clear ();</div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.reserve (cloud_size);</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160; </div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;        <span class="comment">// Define point cloud parameters</span></div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#a2185a6453f8ad905d7bdf7b45754a160">width</a> = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span> (width_arg);</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#a4f34b45220c57f96607513ffad0d9582">height</a> = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span> (height_arg);</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#a3ca88d8ebf6f4f35acbc31cdfb38aa94">is_dense</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160; </div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160;        <span class="comment">// Calculate center of disparity image</span></div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;        centerX = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (width_arg / 2);</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;        centerY = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (height_arg / 2);</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">float</span> fl_const = 1.0f / focalLength_arg;</div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160;        <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> bad_point = std::numeric_limits&lt;float&gt;::quiet_NaN ();</div>
<div class="line"><a name="l00242"></a><span class="lineno">  242</span>&#160; </div>
<div class="line"><a name="l00243"></a><span class="lineno">  243</span>&#160;        i = 0;</div>
<div class="line"><a name="l00244"></a><span class="lineno">  244</span>&#160;        <span class="keywordflow">for</span> (y = -centerY; y &lt; +centerY; ++y)</div>
<div class="line"><a name="l00245"></a><span class="lineno">  245</span>&#160;          <span class="keywordflow">for</span> (x = -centerX; x &lt; +centerX; ++x)</div>
<div class="line"><a name="l00246"></a><span class="lineno">  246</span>&#160;          {</div>
<div class="line"><a name="l00247"></a><span class="lineno">  247</span>&#160;            <a class="code" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> newPoint;</div>
<div class="line"><a name="l00248"></a><span class="lineno">  248</span>&#160;            <span class="keyword">const</span> <span class="keywordtype">float</span>&amp; pixel_depth = depthData_arg[i];</div>
<div class="line"><a name="l00249"></a><span class="lineno">  249</span>&#160;            ++i;</div>
<div class="line"><a name="l00250"></a><span class="lineno">  250</span>&#160; </div>
<div class="line"><a name="l00251"></a><span class="lineno">  251</span>&#160;            <span class="keywordflow">if</span> (pixel_depth)</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;            {</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;              <span class="comment">// Inverse depth decoding</span></div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;              <span class="keywordtype">float</span> depth = focalLength_arg / pixel_depth;</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160; </div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;              <span class="comment">// Generate new points</span></div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;              newPoint.x = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span> (x) * depth * fl_const;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160;              newPoint.y = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span> (y) * depth * fl_const;</div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;              newPoint.z = depth;</div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160; </div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;            }</div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;            {</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;              <span class="comment">// Generate bad point</span></div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160;              newPoint.x = newPoint.y = newPoint.z = bad_point;</div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;            }</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160; </div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;            cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.push_back (newPoint);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;          }</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160; </div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160;      }</div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_a2185a6453f8ad905d7bdf7b45754a160"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#a2185a6453f8ad905d7bdf7b45754a160">pcl::PointCloud::width</a></div><div class="ttdeci">uint32_t width</div><div class="ttdoc">The point cloud width (if organized as an image-structure).</div><div class="ttdef"><b>Definition:</b> point_cloud.h:413</div></div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_a3ca88d8ebf6f4f35acbc31cdfb38aa94"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#a3ca88d8ebf6f4f35acbc31cdfb38aa94">pcl::PointCloud::is_dense</a></div><div class="ttdeci">bool is_dense</div><div class="ttdoc">True if no points are invalid (e.g., have NaN or Inf values).</div><div class="ttdef"><b>Definition:</b> point_cloud.h:418</div></div>
<div class="ttc" id="aclasspcl_1_1_point_cloud_html_a4f34b45220c57f96607513ffad0d9582"><div class="ttname"><a href="classpcl_1_1_point_cloud.html#a4f34b45220c57f96607513ffad0d9582">pcl::PointCloud::height</a></div><div class="ttdeci">uint32_t height</div><div class="ttdoc">The point cloud height (if organized as an image-structure).</div><div class="ttdef"><b>Definition:</b> point_cloud.h:415</div></div>
</div><!-- fragment -->
</div>
</div>
<a id="ab75504ecc6fa90059ae3d7839a4245d3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab75504ecc6fa90059ae3d7839a4245d3">&#9670;&nbsp;</a></span>convert() <span class="overload">[3/3]</span></h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename PointT &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static void <a class="el" href="structpcl_1_1io_1_1_organized_conversion.html">pcl::io::OrganizedConversion</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a>, false &gt;::convert </td>
          <td>(</td>
          <td class="paramtype">typename std::vector&lt; uint16_t &gt; &amp;&#160;</td>
          <td class="paramname"><em>disparityData_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">typename std::vector&lt; uint8_t &gt; &amp;&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>width_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">size_t&#160;</td>
          <td class="paramname"><em>height_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>focalLength_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>disparityShift_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>disparityScale_arg</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classpcl_1_1_point_cloud.html">pcl::PointCloud</a>&lt; <a class="el" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> &gt; &amp;&#160;</td>
          <td class="paramname"><em>cloud_arg</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Convert disparity image to point cloud </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">disparityData_arg</td><td>input depth image </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">width_arg</td><td>width of disparity image </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">height_arg</td><td>height of disparity image </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">focalLength_arg</td><td>focal length </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">disparityShift_arg</td><td>disparity shift </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">disparityScale_arg</td><td>disparity scaling </td></tr>
    <tr><td class="paramdir">[out]</td><td class="paramname">cloud_arg</td><td>output point cloud </td></tr>
  </table>
  </dd>
</dl>
<div class="fragment"><div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;      {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;        <span class="keywordtype">size_t</span> i;</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;        <span class="keywordtype">size_t</span> cloud_size = width_arg * height_arg;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        <span class="keywordtype">int</span> x, y, centerX, centerY;</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160; </div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160;        assert(disparityData_arg.size()==cloud_size);</div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160; </div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <span class="comment">// Reset point cloud</span></div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.clear ();</div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.reserve (cloud_size);</div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160; </div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;        <span class="comment">// Define point cloud parameters</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#a2185a6453f8ad905d7bdf7b45754a160">width</a> = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span> (width_arg);</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#a4f34b45220c57f96607513ffad0d9582">height</a> = <span class="keyword">static_cast&lt;</span>uint32_t<span class="keyword">&gt;</span> (height_arg);</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;        cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#a3ca88d8ebf6f4f35acbc31cdfb38aa94">is_dense</a> = <span class="keyword">false</span>;</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160; </div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160;        <span class="comment">// Calculate center of disparity image</span></div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;        centerX = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (width_arg / 2);</div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;        centerY = <span class="keyword">static_cast&lt;</span><span class="keywordtype">int</span><span class="keyword">&gt;</span> (height_arg / 2);</div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160; </div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;        <span class="keyword">const</span> <span class="keywordtype">float</span> fl_const = 1.0f / focalLength_arg;</div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;        <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">float</span> bad_point = std::numeric_limits&lt;float&gt;::quiet_NaN ();</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160; </div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        i = 0;</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;        <span class="keywordflow">for</span> (y = -centerY; y &lt; +centerY; ++y)</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;          <span class="keywordflow">for</span> (x = -centerX; x &lt; +centerX; ++x)</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160;          {</div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;            <a class="code" href="structpcl_1_1_point_x_y_z_r_g_b_a.html">PointT</a> newPoint;</div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;            <span class="keyword">const</span> uint16_t&amp; pixel_disparity = disparityData_arg[i];</div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;            ++i;</div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160; </div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;            <span class="keywordflow">if</span> (pixel_disparity)</div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;            {</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160;              <span class="comment">// Inverse depth decoding</span></div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;              <span class="keywordtype">float</span> depth = focalLength_arg / (<span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span> (pixel_disparity) * disparityScale_arg + disparityShift_arg);</div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160; </div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;              <span class="comment">// Generate new points</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;              newPoint.x = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span> (x) * depth * fl_const;</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;              newPoint.y = <span class="keyword">static_cast&lt;</span><span class="keywordtype">float</span><span class="keyword">&gt;</span> (y) * depth * fl_const;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;              newPoint.z = depth;</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160; </div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;            }</div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;            {</div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;              <span class="comment">// Generate bad point</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;              newPoint.x = newPoint.y = newPoint.z = bad_point;</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            }</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160; </div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;            cloud_arg.<a class="code" href="classpcl_1_1_point_cloud.html#af16a62638198313b9c093127c492c884">points</a>.push_back (newPoint);</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;          }</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160; </div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;      }</div>
</div><!-- fragment -->
</div>
</div>
<hr/>该结构体的文档由以下文件生成:<ul>
<li>io/include/pcl/compression/<a class="el" href="organized__pointcloud__conversion_8h_source.html">organized_pointcloud_conversion.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>pcl</b></li><li class="navelem"><b>io</b></li><li class="navelem"><a class="el" href="structpcl_1_1io_1_1_organized_conversion_3_01_point_t_00_01false_01_4.html">OrganizedConversion&lt; PointT, false &gt;</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
  </ul>
</div>
</body>
</html>
